package com.taxshare.mybatis.entity;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Setter;

import java.util.Date;

@Setter
public class BaseEntity {

    /**
     * 记录时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @TableField(value = "create_userid", fill = FieldFill.INSERT)
    private String createUserid;

    @TableField(value = "update_userid", fill = FieldFill.INSERT_UPDATE)
    private String updateUserid;

    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    private String tenantId;

    public String getCreateUserid() {
        return createUserid;
    }

    public String getUpdateUserid() {
        return updateUserid;
    }

    public String getTenantId() {
        return tenantId;
    }

    public String getCreateTime() {
        return createTime == null ? null : DateUtil.format(createTime, "yyyy-MM-dd HH:mm:ss");
    }

    public String getUpdateTime() {
        return updateTime == null ? null : DateUtil.format(updateTime, "yyyy-MM-dd HH:mm:ss");
    }

}

